package com.binance.notification.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.binance.master.models.APIRequest;
import com.binance.master.models.APIResponse;
import com.binance.notification.api.IAbnormalTradeApi;
import com.binance.notification.api.request.GetAbnormalTradeNoticeInfoListRequest;
import com.binance.notification.web.service.IAbnormalTradeService;

@RestController
public class AbnormalTradeController implements IAbnormalTradeApi {

    @Autowired
    private IAbnormalTradeService abnormalTradeService;

    @Override
    public APIResponse<String> getAbnormalTradeNoticeInfoList(
            @RequestBody @Validated APIRequest<GetAbnormalTradeNoticeInfoListRequest> request) throws Exception {
        return APIResponse.getOKJsonResult(this.abnormalTradeService.getAbnormalTradeNoticeInfoList(
                request.getBody().getPage(), request.getBody().getOffset(), request.getLanguage().getCode()));
    }

}
